package com.dq.service.goods;

import com.dq.controller.in.goods.stock.OrgStockCheckQuery;
import com.dq.exception.customException.AdminException;
import com.dq.controller.in.goods.stock.StockChangeRecordQuery;
import com.dq.domain.goods.Goods;
import com.dq.domain.goods.Product;
import com.dq.domain.orders.info.OrderInfo;
import com.dq.domain.goods.stock.StockChangeRecord;
import com.dq.domain.sys.section.SysSection;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author cf
 */
public interface StockChangeRecordService {
    List<StockChangeRecord> list(StockChangeRecordQuery orgStockChangeQuery)throws AdminException;
    Long count(StockChangeRecordQuery orgStockChangeQuery)throws AdminException;

    public List<StockChangeRecord> listGroupByGoodsAndOrg(StockChangeRecordQuery stockChangeRecordQuery) throws AdminException;
    public Long countGroupByGoodsAndOrg(StockChangeRecordQuery stockChangeRecordQuery) throws AdminException;

    public void orderInfo2Stock(SysSection section, OrderInfo orderInfo, StockChangeRecord.ChangeDirection changeDirection, StockChangeRecord.ChangeType changeType) throws AdminException;
    public StockChangeRecord addStockChangeRecord(StockChangeRecord stockChangeRecord) throws AdminException;

    public StockChangeRecord saveStockChangeRecord(StockChangeRecord stockChangeRecordAdd, Goods goods, Product product, SysSection section, boolean judge) throws AdminException;
    public void delStockChangeRecord(Long id)throws AdminException;

    public StockChangeRecord initObject(StockChangeRecord stockChangeRecord) throws AdminException;


    public Long orgStockAll(OrgStockCheckQuery orgStockCheckQuery) throws AdminException;
    public Long orgRealStockAll(OrgStockCheckQuery orgStockCheckQuery) throws AdminException;
    public Long orgExpendAll(OrgStockCheckQuery orgStockCheckQuery) throws AdminException;
    public Long orgSellAll(OrgStockCheckQuery orgStockCheckQuery) throws AdminException;
    public BigDecimal orgSellPriceAll(OrgStockCheckQuery orgStockCheckQuery) throws AdminException;

}
